package com.batchengine.test;

import com.batchengine.util.LoggingFactory;
import com.batchengine.worker.WorkSelector;
import org.apache.log4j.Logger;

/**
 * Created by sunil.incubator@yahoo.com.
 * User: sunil.kalva
 * Date: Jul 13, 2009
 */
public class HelloWorkSelector extends WorkSelector<String> {

    private static int counter = 1;
    private static final Logger logger = LoggingFactory.createLogger();

    @Override
    public boolean fillWork() throws InterruptedException {

        addToQ(java.lang.String.valueOf(counter++));
        logger.info(java.lang.String.format("Adding ==>%s; After adding size %s", counter, getTotalWorkSize()));
        return true;
    }
}
